package com.mvc.web.order.vo;


public class OrderEnum {
	
	
	
	public static enum OrderStatus{
		
		ONE("未开始",1,"http://huoyunbaba.oss-cn-beijing.aliyuncs.com/img_status_1.png"), 
		TWO("运送中",2,"http://huoyunbaba.oss-cn-beijing.aliyuncs.com/img_status_2.png"),
		THREE("已送达",3,"http://huoyunbaba.oss-cn-beijing.aliyuncs.com/img_status_3.png"),
		FOUR("已结束",4,"http://huoyunbaba.oss-cn-beijing.aliyuncs.com/img_status_4.png");
		private String name;
		private int index;
		private String color;
		OrderStatus(String name,int index,String color){
			this.name = name;
			this.index = index;
			this.color = color;
		}
		public String getName() {
			return name;
		}
		public void setName(String name) {
			this.name = name;
		}
		public int getIndex() {
			return index;
		}
		public void setIndex(int index) {
			this.index = index;
		}
		public String getColor() {
			return color;
		}
		public void setColor(String color) {
			this.color = color;
		}
		public static String getNameByIndex(int index){
			for(OrderStatus es : OrderStatus.values()){
				if(es.getIndex() == index){
					return es.getName();
				}
			}
			return null;
		}
		public static String getColorByIndex(int index){
			for(OrderStatus es : OrderStatus.values()){
				if(es.getIndex() == index){
					return es.getColor();
				}
			}
			return null;
		}
	}
}
